package com.zx.idc.backend.gui.sys;


import com.zx.idc.backend.gui.common.BaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.sys.entity.SysAuthIpSeg;
import com.zx.idc.ds.sys.service.ISysAuthIpSegService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 授权ip地址段表 前端控制器
 * </p>
 *
 * @author rxliuli
 * @since 2019-01-31
 */
@RestController
@RequestMapping("/api/sysAuthIpSeg")
public class SysAuthIpSegController extends BaseApi {
    @Autowired
    private ISysAuthIpSegService service;

    @GetMapping("/list-for-all")
    @RequiresPermissions("system-configuration:sys-user")
    public Result<List<SysAuthIpSeg>> listForAll() {
        return success(service.listForAll());
    }

    @PostMapping("/update/batch")
    @RequiresPermissions("system-configuration:sys-user:edit")
    public Result<Boolean> updateBatch(@RequestBody List<SysAuthIpSeg> list){
        return success(service.updateBatch(list));
    }
}

